package com.littlerpc.protocol.net.common;

import com.littlerpc.protocol.codec.Serializer;
import lombok.Setter;

/**
 *
 * @author ChengPeng
 * @date 2017/6/13
 * 客户端请求接口
 */
@Setter
public abstract class RpcClient {

    public static Class<?>[] constructorParameterTypes = new Class<?>[]{String.class,int.class,Serializer.class};

    public int remotePort;
    public String remoteHost;
    public Serializer serializer;

    public RpcClient(String remoteHost, int remotePort, Serializer serialize) {
        this.remotePort = remotePort;
        this.remoteHost = remoteHost;
        this.serializer = serialize;
    }

    /**
     * 发送请求到服务端
     */
    public abstract Object send(RpcRequest request);

}
